<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <title>字符串常用方法</title>
</head>
<body>
<script> 
    var ss="abc0123def&#*";

    ss.charAt(0);
    ss[0]
//    console.log(ss.charAt(-1))   //空
//    alert(String.fromCharCode(97));

    console.log(ss.slice(0,2))

    var ssss='abcdefg 0123456789 ABCDEFG';
    for(var i=0;i<ssss.length;i++){
        document.write('下标为'+i+'的字符是:'+ssss.charAt(i)+'-编码为:'+ssss.charCodeAt(i)+'<br>')
    }
   console.log(String.fromCharCode(97,65,48))

</script>
</body>
</html>